add tests and harden command policy - #2
Conversation
|
Nice work on the security hardening! The base64 decode check and new dangerous command patterns are valuable additions. Some thoughts: Security improvements 👍
Potential improvements to consider:
Regarding CONTRIBUTING.md overlap — both our PRs update this file. I'm happy to rebase #16 on top of this if it merges first. Thanks for the security improvements — these are orthogonal to the test infrastructure work in #16 and complement it well. |
|
Thanks for the careful review. I pushed
Validation: Agreed on the framework/coverage point: this PR intentionally stays focused on the security hardening and first Node test baseline. The broader coverage/watch-mode/cross-platform matrix work in #16 remains complementary. |
|
Hi @luochen211, thanks for the hardening patch and the additional tests! After reading this PR alongside #16, I have a few suggestions on merge ordering and structure so the two efforts compose cleanly. Key observation The test cases in #2 and #16 are complementary, not redundant:
However, the test infrastructure overlaps. #16 introduces vitest with vitest.config.ts, a GitHub Actions workflow, helpers/fixtures, and a TESTING.md doc. #2 introduces a node:test script, a tsconfig include change, and a root-level tests/ directory. Keeping both runners will fragment CI and contributor mental models. Recommendation
End state: hardened policy + comprehensive coverage + your unique edge cases, all on a single test framework. Thanks again for the contribution! |
|
Updated this branch against current What changed:
Validation: |
|
Thanks for your first contribution to the project! 🎉 |
add tests and harden command policy
Summary
Adds the first automated test baseline and hardens command policy checks for destructive shell commands.
Changes
pnpm testusing Node's built-in test runner viatsx.pnpm testintopnpm checkand includestestsin TypeScript checking.rm -rftargets,find ... -delete,git clean -fd, and base64-encoded destructive payloads.Validation
pnpm checkNote: lint still reports pre-existing warnings only; there are no lint errors.